初步使用mmdetection3d进行点云目标检测 | 您所在的位置:网站首页 › mmdetection3d lidar only › 初步使用mmdetection3d进行点云目标检测 |
初步使用mmdetection3d进行点云目标检测
环境搭建项目结构demo测试单模态多模态
数据集准备数据集下载加载点云数据
训练修改训练参数开始训练可能遇到的问题
测试开始测试测试结果
参考资料
MMDetection3D 是一个基于 PyTorch 的3D目标检测开源工具箱,涵盖了3D目标检测、单目3D目标检测、多模态3D目标检测、3D语义分割等三维深度学习任务。 创建Anaconda虚拟环境 conda create -n mmdet3d python=3.7进入虚拟环境 安装对应版本的cuda、pytorch、torchvision 安装mmcv-full、MMDection、MMSegmentation pip install mmcv-full pip install mmdet pip install MMSegmentation克隆MMDection3D代码仓库 git clone https://github.com/open-mmlab/mmdetection3d.git跳转至代码目录后 安装依赖包 pip install -e .手动安装无法自动找到的依赖和冲突的依赖 项目结构
使用预训练好的VoteNet模型进行3D单模态目标检测 python demo/pcd_demo.py demo/data/sunrgbd/000017.bin configs/votenet/votenet_8xb16_gbd-3d.py checkpoints/votenet_16x8_sunrgbd-3d-10class_20210820_162823-bf11f014.pth测试图片: 使用预训练好的ImVoteNet模型进行3D多模态目标检测 python demo/multi_modality_demo.py demo/data/sunrgbd/000017.bin demo/data/sunrgbd/000017.jpg demo/data/sunrgbd/sunrgbd_000017_infos.pkl configs/imvotenet/imvotenet_stage2_8xb16_sunrgbd-3d.py checkpoints/imvotenet_stage2_16x8_sunrgbd-3d-10class_20210819_192851-1bcd1b97.pth使用 KITTI 3D 目标检测数据集进行实验 数据集可以直接在官网下载 创建 KITTI 点云数据,首先需要加载原始的点云数据并生成相关的包含目标标签和标注框的数据标注文件,同时还需要为 KITTI 数据集生成每个单独的训练目标的点云数据,并将其存储在 data/kitti/kitti_gt_database 的 .bin 格式的文件中,此外,需要为训练数据或者验证数据生成 .pkl 格式的包含数据信息的文件 按照如下命令创建最终的KITTI数据集: # 进入mmdetection3d主目录 cd mmdetection3d # 创建文件夹 mkdir ./data/kitti/ && mkdir ./data/kitti/ImageSets # Download data split wget -c https://raw.githubusercontent.com/traveller59/second.pytorch/master/second/data/ImageSets/test.txt --no-check-certificate --content-disposition -O ./data/kitti/ImageSets/test.txt wget -c https://raw.githubusercontent.com/traveller59/second.pytorch/master/second/data/ImageSets/train.txt --no-check-certificate --content-disposition -O ./data/kitti/ImageSets/train.txt wget -c https://raw.githubusercontent.com/traveller59/second.pytorch/master/second/data/ImageSets/val.txt --no-check-certificate --content-disposition -O ./data/kitti/ImageSets/val.txt wget -c https://raw.githubusercontent.com/traveller59/second.pytorch/master/second/data/ImageSets/trainval.txt --no-check-certificate --content-disposition -O ./data/kitti/ImageSets/trainval.txt # 使用create_data.py进行数据预处理 python tools/create_data.py kitti --root-path ./data/kitti --out-dir ./data/kitti --extra-tag kitti --with-plane最终数据目录结构如下所示 kitti ├── ImageSets │ ├── test.txt │ ├── train.txt │ ├── trainval.txt │ ├── val.txt ├── testing │ ├── calib │ ├── image_2 │ ├── velodyne │ ├── velodyne_reduced ├── training │ ├── calib │ ├── image_2 │ ├── label_2 │ ├── velodyne │ ├── velodyne_reduced │ ├── planes (optional) ├── kitti_gt_database │ ├── xxxxx.bin ├── kitti_infos_train.pkl ├── kitti_infos_val.pkl ├── kitti_dbinfos_train.pkl ├── kitti_infos_test.pkl ├── kitti_infos_trainval.pkl 训练数据集和环境都配置好后,就可以开始训练,使用命令python tools/train.py -h可以查看有哪些训练参数: 在/mmdetection3d/configs/pointpillars_hv_secfpn_8xb6-160e_kitti-3d-3class.py文件中,可以修改epoch轮数,学习率等参数 使用以下命令开始训练: python tools/train.py configs/pointpillars/pointpillars_hv_secfpn_8xb6-160e_kitti-3d-3class.py torch.cuda.OutOfMemoryError: CUDA out of memory 减小batch的大小 RuntimeError: cuDNN error: CUDNN_STATUS_INTERNAL_ERROR 可能是pytorch cuda cudnn之间版本匹配问题 引入如下语句,不使用cudnn加速 看问题是否排除 import torch torch.backends.cudnn.enabled = False还有可能是内存不足等问题 OSError: [WinError 1455] 页面文件太小,无法完成操作,增加页面大小![]() 使用命令python tools/test.py -h可以查看有哪些测试参数 python tools/test.py configs/pointpillars/pointpillars_hv_secfpn_8xb6-160e_kitti-3d-3class.py work_dirs/pointpillars_hv_secfpn_8xb6-160e_kitti-3d-3class/epoch_3.pth 【MMDetection3D】环境搭建,使用PointPillers训练&测试&可视化KITTI数据集 KITTI 3D目标检测数据集解析(完整版) MMdetection3d环境搭建、使用MMdetection3d做3D目标检测训练自己的数据集、测试、可视化,以及常见的错误 MMdetection3d 安装与 Demo MMdetection3d 训练与测试 |
CopyRight 2018-2019 实验室设备网 版权所有 |